package com.bestcem.xm.om.dao;

import com.bestcem.xm.om.dao.param.PlatformParamDO;
import com.bestcem.xm.om.entity.OmPlatform;
import com.bestcem.xm.om.enums.PlatformStatusEnum;
import com.bestcem.xm.om.grpc.service.param.OmPlatformParam;

import java.util.Collection;
import java.util.List;

/**
 * @author zhangfeng <feng.zhang@idiaoyan.com>
 * @version v1.0
 * @date 2022/3/22 14:48
 */
public interface PlatformDao {
    /**
     * 查询开发平台列表
     *
     * @param param
     * @return com.bestcem.xm.om.service.dto.common.PageDTO<com.bestcem.xm.om.entity.Platform>
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/3/22 14:50
     */
    List<OmPlatform> listPlatform(PlatformParamDO param);

    /**
     * 查询总数
     *
     * @param param
     * @return java.lang.Integer
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/3/22 14:58
     */
    Integer countPlatform(PlatformParamDO param);

    /**
     * 根据id进行查询
     *
     * @param id
     * @return com.bestcem.xm.om.entity.Platform
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/3/22 16:45
     */
    OmPlatform findById(String id);

    /**
     * 根据orgId进行查询
     *
     * @param orgId
     * @return com.bestcem.xm.om.entity.Platform
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/3/22 16:45
     */
    OmPlatform findOneByOrgId(String orgId);

    /**
     * 根据platformCode进行查询
     *
     * @param platformCode
     * @return com.bestcem.xm.om.entity.Platform
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/6/15 17:55
     */
    OmPlatform findOneByPlatformCode(String platformCode);

    /**
     * 保存数据
     *
     * @param omPlatform
     * @return java.lang.String
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/3/30 17:13
     */
    String insert(OmPlatform omPlatform);

    /**
     * 更新数据
     *
     * @param omPlatform
     * @return void
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/3/30 22:03
     */
    void update(OmPlatform omPlatform);

    /**
     * 根据条件查询信息
     *
     * @param param
     * @return java.util.List<com.bestcem.xm.om.entity.OmPlatform>
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/6/23 16:09
     */
    List<OmPlatform> listByPlatformParam(OmPlatformParam param);

    /**
     * 根据状态查询所有合作信息
     *
     * @param status
     * @return java.util.List<com.bestcem.xm.om.entity.OmPlatform>
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/6/23 17:21
     */
    List<OmPlatform> listByStatus(PlatformStatusEnum status);

    /**
     * 根据合作商code查询列表信息
     *
     * @param platformCodes
     * @return java.util.List<com.bestcem.xm.om.entity.OmPlatform>
     * @author zhangfeng <feng.zhang@idiaoyan.com>
     * @date 2022/6/28 14:03
     */
    List<OmPlatform> listByCodes(Collection<String> platformCodes);
}
